package pro.softzhang.algo.lc200;

import pro.softzhang.algo.common.ListNode;
import pro.softzhang.algo.flag.book.BCrackingVI;
import pro.softzhang.algo.flag.difficulty.DGreen;
import pro.softzhang.algo.flag.knowledge.KLinkedList;
import pro.softzhang.algo.flag.x.XInteresting;
import pro.softzhang.algo.flag.x.XOptimal;

/**
 * 237. 删除链表中的节点
 * https://leetcode.cn/problems/delete-node-in-a-linked-list
 */
@DGreen
@KLinkedList
@XInteresting
@BCrackingVI
public class LC237_DeleteNodeInALinkedList {
    public static void main(String[] args) {

    }

    /**
     * 咋说呢，有点脑筋急转弯的意思
     */
    @XOptimal
    static
    class Solution {
        public void deleteNode(ListNode node) {
            node.val = node.next.val;
            node.next = node.next.next;
        }
    }
}
